//
//  DrRobotViewController.h
//  DrRobot
//
//  Created by Zoltan Szeredi on 6/11/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "netcom.h"

@interface DrRobotViewController : UIViewController {
    UITextField *addressField;
    UITextField *portField;
    UITextField *amountField;
    UIButton *pingButton;
    UITextView *debugConsole;
    UISlider *percentageSlider;
    
    UIButton *forwardButton;
    UIButton *backwardButton;
    UIButton *leftButton;
    UIButton *rightButton;
    
    UIProgressView *infraredProgress1;
    UIProgressView *infraredProgress2;
    UIProgressView *infraredProgress3;
    UIProgressView *infraredProgress4;
    UIProgressView *infraredProgress5;
    UIProgressView *infraredProgress6;
    
    UIProgressView *ultrasonicProgress1;
    UIProgressView *ultrasonicProgress2;
    UIProgressView *ultrasonicProgress3;
    UIProgressView *ultrasonicProgress4;
    UIProgressView *ultrasonicProgress5;
    UIProgressView *ultrasonicProgress6;


    NSTimer *timer;
    conn_t *conn;
}


@property (nonatomic, retain) IBOutlet UITextField *addressField;
@property (nonatomic, retain) IBOutlet UITextField *portField;
@property (nonatomic, retain) IBOutlet UITextField *amountField;
@property (nonatomic, retain) IBOutlet UIButton *pingButton;
@property (nonatomic, retain) IBOutlet UITextView *debugConsole;
@property (nonatomic, retain) IBOutlet UISlider *percentageSlider;

@property (nonatomic, retain) IBOutlet UIButton *forwardButton;
@property (nonatomic, retain) IBOutlet UIButton *backwardButton;
@property (nonatomic, retain) IBOutlet UIButton *leftButton;
@property (nonatomic, retain) IBOutlet UIButton *rightButton;

@property (nonatomic, retain) IBOutlet UIProgressView *infraredProgress1;
@property (nonatomic, retain) IBOutlet UIProgressView *infraredProgress2;
@property (nonatomic, retain) IBOutlet UIProgressView *infraredProgress3;
@property (nonatomic, retain) IBOutlet UIProgressView *infraredProgress4;
@property (nonatomic, retain) IBOutlet UIProgressView *infraredProgress5;
@property (nonatomic, retain) IBOutlet UIProgressView *infraredProgress6;

@property (nonatomic, retain) IBOutlet UIProgressView *ultrasonicProgress1;
@property (nonatomic, retain) IBOutlet UIProgressView *ultrasonicProgress2;
@property (nonatomic, retain) IBOutlet UIProgressView *ultrasonicProgress3;
@property (nonatomic, retain) IBOutlet UIProgressView *ultrasonicProgress4;
@property (nonatomic, retain) IBOutlet UIProgressView *ultrasonicProgress5;
@property (nonatomic, retain) IBOutlet UIProgressView *ultrasonicProgress6;

-(IBAction) pingButtonClicked : (id)sender;

-(IBAction) forwardButtonClicked : (id)sender;
-(IBAction) backwardButtonClicked : (id)sender;
-(IBAction) leftButtonClicked : (id)sender;
-(IBAction) rightButtonClicked : (id)sender;

-(IBAction) touchpathClicked : (id)sender;

-(void)update_gui;
+(double) ad2dis:(unsigned int) advalue;

@end
